package com.dao.impl;

import com.bean.UserBean;
import com.dao.UserDao;
import com.util.JdbcUtil;
import com.util.PageUtil;

import java.sql.SQLException;
import java.util.List;

public class UserDaoImpl implements UserDao {


    @Override
    public int insert(UserBean userBean) throws SQLException {
        return 0;
    }

    @Override
    public List<UserBean> queryData(Object... values) throws IllegalAccessException, SQLException, InstantiationException {
        return null;
    }
    @Override
    public int update(UserBean userBean) throws SQLException {
        return 0;
    }

    @Override
    public int deleteById(Object id) throws SQLException {
        return 0;
    }

    @Override
    public PageUtil<UserBean> queryDataPage(int currentPgae, int pageSize, UserBean userBean) throws IllegalAccessException, SQLException, InstantiationException {
        return null;
    }

    @Override
    public UserBean userLogin(String userName, String password) {
        return null;
    }

    @Override
    public UserBean userLoginMobile(String phone) throws IllegalAccessException, SQLException, InstantiationException {
        String sql  ="select * from dd_user where mobilephone=?";
         List<UserBean> userBeanList =  JdbcUtil.queryData(sql,UserBean.class,phone);
         if (userBeanList.size()>0){
             return userBeanList.get(0);
         }
        return null;
    }
}
